import request from '@/utils/request';

export function treeMenu(query) {
  return request({
    // url: '/api/system/menu/treeMenu',
    url: `/sociaty/user/applylist${query}`,
    method: 'get'
  })
}

export function saveMenu(form) {
  return request({
    url: '/sociaty/direct/add',
    method: 'post',
    data: form
  })
}

export function updateMenu(form) {
  return request({
    url: '/menu/update',
    method: 'post',
    data: form
  })
}
export function cacheMenu() {
  return request({
    url: '/menu/cache',
    method: 'get',
  })
}

export function deleteMenu(sociaty_id) {
  return request({
    url: '/sociaty/direct/delete',
    method: 'post',
    data: { 'sociaty_id': sociaty_id }
  });
}
export function verifyMenu(data) {
  return request({
    url: '/sociaty/user/verifyapply',
    method: 'post',
    data: data
  });
}

// ========================== 上面是用到的

export function getSysPermissionPage(query) {
  return request({
    url: '/api/system/menu/listPage',
    method: 'post',
    data: query
  });
}

export function getSysPermissionById(id) {
  return request({
    url: '/api/system/menu/getById',
    method: 'post',
    data: { 'id': id }
  });
}
